A5Storage::SubContainer SetItemFromFile Method

Syntax

.SetItemFromFile as L (Source as C, ContentType as C, TargetPath as C [, Offset as N [, Length as N]])

Arguments

SourceCharacter

The file that contents are copied from.

ContentTypeCharacter

The content type.

TargetPathCharacter

The item in the Storage container to set the contents.

OffsetNumeric

Default = 0. Offset into the file where copying should begin. A value of 0 will start copying at the beginning of the file.

LengthNumeric

Default = -1. The amount of data to copy. If -1, all data is copied starting at the offset.

Returns

ResultLogical

Returns .T. if the operation succeeds, otherwise .F. (see .CallResult for additional error information.)

Description

Copies a file to the specified Storage item..

Example

dim CallResult as CallResult
dim SubContainer as A5Storage::SubContainer = null_value()

CallResult = A5Storage::SubContainer::Open(SubContainer, "Provider='Disk';Container='c:\A5Webroot';", "logs")
? CallResult.Success
= .T.

? SubContainer.SetItemFromFile ("c:\temp\MyItem.jpg", "MyItempath/MyItem.jpg")
= .T.